package com.codechuan.hallo_internal.thread;

import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.codechuan.hallo_internal.common.Constant;
import com.codechuan.hallo_internal.entity.SuccessOrder;
import com.codechuan.hallo_internal.utils.ContextUtil;
import com.codechuan.hallo_internal.utils.DialogUtil;
import com.codechuan.hallo_internal.utils.HalloProjectHttpUtil;

import java.util.HashMap;

/**
 * @Deprecated 获取订单线程
 */
public class RobOrderThread implements Runnable {

    SynContainer synContainer;

    public RobOrderThread(SynContainer synContainer) {
        this.synContainer = synContainer;
    }

    @Override
    public void run() {

        while (Constant.isStart) {
            SuccessOrder successOrder = this.synContainer.getSuccessOrder();
            if (successOrder != null) {
                // 获取订单信息,如果状态为true表示已经执行过pk直接跳过

                if (Constant.XCX_IS_CHECK) {
                    HalloProjectHttpUtil.submitWeChatMiniOrder(successOrder);
                }

                if (Constant.APP_IS_CHECK) {
                    HalloProjectHttpUtil.submitWeChatAppOrder(successOrder);
                }
                successOrder.setOk(true);
            }

        }
    }
}
